Deadlock Questions and Answers pdf

Deadlock Questions and Answers pdf


Deadlock-Questions-Answers

Define a deadlock?

A process is said to be in a state of deadlock if it is waiting for a particular event (e.g. allocation of resources) that will never occur.

Name four necessary conditions for Deadlock?

  • Mutual Exclusion 
  • Hold-and-Wait
  • No Preempting 
  • Circular Wait

Describe the Mutual Exclusion condition for deadlock?

Mutual exclusion condition indicates the locking of resources in exclusive mode, also known as a non-shareable mode. Each resource may be allocated to only one process at a time. If another process needs to use that resources, then the requesting process must wait until the resources have been released.

What is the Hold-and Wait condition for deadlock?

In a deadlock, each involved process holds one or more resources and waits for additional resources, which are currently being held by other processes in the system. It means that a deadlock may occur only if every involved process holds one or more resources and further needs additional resources.

What is the No Preempting condition for deadlock?

Previously granted resources in a deadlocked system cannot be taken away forcefully from the processes holding them. Suppose process P1 holds the resource R1 and waits for the resource R2, which is locked by the process P2 in accusation mode. The condition of no-preempting requires that the operating system cannot preempt (or release forcefully) the resource R2 (for process P1) from the process P2.

Define Circular Wait condition in deadlock?

A closed chain of processes must exist for a system to be in a deadlock, such that each process in the chain holds at least one resource needed by the next process in the chain. Suppose there are three processes P1, P2, and P3, and three resources R1, R2, and R3. The process P1 is waiting to get R1, which is held (acquired) by the process P2, the process P2 is waiting to get R2, which is held by the process P3, and P3 is waiting to get R3, which is held by the process P1.  

Define Safe, Unsafe, and Deadlock state with the help of a diagram?

  1. If a system is in a safe state, it implies that there will be no deadlocks.
  2. If a system is in an unsafe state then there is the possibility of deadlock.
  3. To avoid a deadlock, ensure that a system will never enter an unsafe state.

What is the objective of the resource-allocation graph?

It is an analytical tool that is used to verify whether or not a system is in a deadlock state.

Define the edges used in the resource-allocation graph?

Edges in the resource-allocation graph are defined as follows:

Request Edges: represents that process is requesting resources.

Assignment Edges: represents that resources are allocated to the process. 

Compare the resource-allocation graph and resource-allocation graph algorithm?

The resource-allocation graph algorithm is similar to the resource-allocation graph but a new type of edges, called a claim edge (in addition to request and assignment edges) is introduced in it.

Briefly describe Resource-allocation Graph Algorithm?

This graph can be used to avoid deadlock. A claim edge indicates that a process may request resources in the future. The claim edge is represented in the graph by a dashed line. When a process requests a resource, then the claim edge is converted into a request edge. Similarly, when a process releases a resource, the assignment edge is re-converted into the claim edge.

Introduced Banker's Algorithm?

Banker's algorithm is a resource allocation and deadlock avoidance algorithm in a computer network system. It is used to avoid deadlocks in a system having multiple instances for each resource type. This algorithm was first proposed by Dijkstra in 1965.

Why the Banker's Algorithm is named so?

This algorithm is named as Banker's algorithm because it could be used in a banking computer network system to ensure that the bank never allocates its available cash in such a way that in the future it could no longer satisfy the cash needs of all its customers or clients.

What is the difference between Deadlock Prevention and Deadlock Avoidance in an operating system?

In deadlock prevention, we restrict resource requests to prevent four conditions of deadlock, However, deadlock prevention reduces resource utilization and slows down the execution of processes.
Deadlock avoidance allows for more concurrently than prevention. With deadlock avoidance in the operating system, a decision is made dynamically whether the current resource allocation request ( if granted) will potentially lead to a deadlock or not lead to deadlock. If there is no possibility of deadlock, the request is fulfilled otherwise not.

For deadlock recovery through process termination, what are the three possibilities?

The simplest way to break a deadlock in a system is to kill (or terminate) one or more deadlock processes, There are three possibilities to terminate deadlocked processes. 
These are:
  • Terminate all deadlocked processes. 
  • Terminate one process at a time.
  • Terminate of a process not in a cycle.

If a process is waiting for fora particular event that will never occur, then the process is said to be in a state of?

Deadlock 

Which deadlock conditions indicate that a resource can be utilized by one process at a time?

Mutual exclusion deadlock conditions indicate that a resource can be utilized by one process at a time. 

Which deadlock conditions indicates that the operating system cannot take away the resources from the process forcefully?

No preempting

Which is an analytical tool used to verify whether or not a system is in a deadlock state?

Resource Allocation Graph is an analytical tool used to verify whether or not a system is in a deadlock state.

The node of a process in a resource allocation graph is denoted by?

Circle

An arrow line drawn from process to resource is referred to as?

Request edge

Which edges represents that the resource is allocated to the process?

Assignment edge represents that the resource is allocated to the process.

If the resource allocation graph contains no cycle, then the system is in?

Safe State 

How many types of edges are in a resource allocation graph?

2 types of edges are in a resource allocation graph

Which is true about the deadlock allocation graph?

By ensuring that at least one of the four conditions cannot hold in the allocation graph.



Comments

Popular posts from this blog

Modern scenario of information technology:

CPU scheduling questions and answers pdf